Add a mutex in ActivateSharedLibsPackage The ActivateSharedLibsPackage is called from the ActivatePackageImpl function, which during boot can be called concurrently from different threads. However, the ActivateSharedLibsPackage mutates the shared state in /apex/sharedlibs, which means that we can have a race condition of 2 different threads trying to create the same symlink in under /apex/sharedlibs. This change fixes the race condition by introducing a static mutex in ActivateSharedLibsPackage. This is not perfect, but it's the least risky fix that we can introduce in QPR. A proper fix will be implemented in U+. Test: atest ApexTestCases Test: atest sharedlibs_host_tests Bug: 240291921 Change-Id: I64d57fc2b9e680edab7d77b0d9e80ae42f112feb 
1 file changed